Simplify icons gallery & replace tuple-based custom icons with JSX#2441
Merged
joyenjoyer merged 4 commits intoINSTUI-4892-tidy-up-the-icons-galleryfrom Mar 11, 2026
Merged
Conversation
7e9e897 to
d74033e
Compare
|
…build-time JSX components Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…with flexbox Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
f26bcba to
32f4d40
Compare
matyasf
reviewed
Mar 11, 2026
31e63df
into
INSTUI-4892-tidy-up-the-icons-gallery
8 of 9 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two refactoring commits that improve the icons infrastructure:
1. Replace tuple-based custom icons with build-time JSX components
generate-custom-index.ts: Instead of generatingiconNodearrays (tuples of[tagName, attributes]) that get rendered at runtime viaReact.createElement, we now generate.tsxfiles with actual JSX path components that accept acolorpropwrapCustomIcon.tsx: Simplified — no longer iterates over tuples to create elements; just renders thePathsComponentdirectlysvg2jsx.js: ExtractedconvertSvgAttrNameas a named export so the custom icon generator can reuse itsvgsondependency — no longer needed since we work with raw SVG strings converted to JSX at build time instead of parsing into an AST2. Simplify icons gallery by replacing react-window with flexbox
react-windowGrid and all associated complexity: resize event handlers, column count calculations,CellRendererwrapper, container width tracking via refs.map(), matching how the legacy icons page worked — the icon set is not large enough to need virtualisationTextInputuncontrolled: removed the dualsearchInput/searchQuerystate that was causing the input to feel sluggishIconSourcetype andsourcefield fromIconInfotoLowerCase()out of the filter loopReasoning
iconNodeformat added runtime overhead and complexity (manualReact.createElementcalls, gradient ID injection via string matching). Generating JSX at build time is simpler, more idiomatic React, and lets the bundler optimise the outputTest plan
pnpm run bootstrapto regenerate custom icons (verifies the new.tsxgeneration)pnpm run dev) and verify icons gallery loads correctly🤖 Generated with Claude Code